import axios from '@/libs/axios1'
let jsonHeaders = { 'content-type': 'application/json;charset=UTF-8' }
let base = '/testplatform/productGroup'

// 查询产品组列表
export const queryProductGroupList = params => {
    return axios({
        url: `${base}/pageList`,
        method: 'GET',
        params,
        headers: jsonHeaders,
    })
}

// 创建产品组
export const addProductGroup = data => {
    return axios({
        url: `${base}/saveProductGroup`,
        method: 'POST',
        data,
        headers: jsonHeaders,
    })
}

// 修改产品组
export const updateProductGroup = data => {
    return axios({
        url: `${base}/updateProductGroup`,
        method: 'PUT',
        data,
        headers: jsonHeaders,
    })
}

// 删除产品组
export const deleteProductGroup = id => {
    return axios({
        url: `${base}/delProductGroup/${id}`,
        method: 'DELETE',
        headers: jsonHeaders,
    })
}

// 根据产品组id查询版本
export const getProductGroupDetail = id => {
    return axios({
        url: `${base}/getProductVersion/${id}`,
        method: 'GET',
        headers: jsonHeaders,
    })
}
